let t
function lazyload() {
    if (t) return
    t = setTimeout(() => {
        let h1 = window.innerHeight || document.documentElement.clientHeight
        let h2 = document.documentElement.scrollTop || document.body.scrollTop
        let showHeight = h1 + h2
        let imgs = $('img')
        imgs.each((index, item) => {
            let imgTop = item.offsetTop
            if (imgTop <= showHeight) {
                item.src = item.getAttribute('data')
            }
        })
        t = null
    }, 500)
}
window.onscroll = lazyload
lazyload()